package cn.iocoder.ny.module.mall.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 代码生成相关配置
 * 
 * @author lc
 */
@Component
@Data
@ConfigurationProperties(prefix = "mall")
public class MallProperties
{
    /** 微信回调地址前缀 */
    public  String wxNotifyUrl;
    /** 是否加密 */
    public boolean encrypted;

    // 静态字段
    public static String WX_NOTIFY_URL;
    public static boolean ENCRYPTED;


    // 使用 @PostConstruct 将非静态字段的值赋给静态字段
    @PostConstruct
    public void init() {
        WX_NOTIFY_URL = this.wxNotifyUrl;
        ENCRYPTED = this.encrypted;


    }
}
